import java.util.*;

public class Calculator {
	private static ArrayList<Integer> list1 = new ArrayList();
	private static ArrayList<Integer> list2 = new ArrayList();
	
	public static void main(String[] args) throws ArraySizeException{
		for(int i = 1; i < 4; i++){
			list1.add(i);
		}
		for(int i = 4; i < 6; i++){
			list2.add(i);
		}

		int number1;
		int number2;
		
		for(int i = 0; i < 3; i++){

			try {
				if(list1.size()<i+1){
					throw new ArraySizeException();
				}
				if(list2.size()<i+1){
					throw new ArraySizeException();
				}			
				number1 = list1.get(i);
				number2 = list2.get(i);			
				number1 = number1 + number2;
				System.out.println(number1);
				} catch(ArraySizeException ex) {
					System.out.println(ex);
				}
			}
		
	}
}
